
function lisetnerAjax(imgNum, ale) {
    var flagTimer = setInterval(function() {
        $.each(imgNum, function(index, val) {
            console.log(val);
            if (!val) {
                return;
            }

            if (imgNum.length - 1 == index) {
                $('.loading').css({'display': "none"})
                $(ale).addClass('slideInDown');
                clearInterval(flagTimer);
                flagTimer = null;
            }
        })

    }, 1000);
}

function closeBar(btnele, parentele) {
    $(btnele).click(function() {
        $(parentele).addClass('slideOutUp').removeClass('slideInDown');
    });
}
function showBar(btnele, parentele) {
    $(btnele).click(function() {
        (parentele).show().addClass('slideInDown').removeClass('slideOutUp');
    });
}
function autoshowBar(parentele) {
    $(parentele).show().addClass('slideInDown').removeClass('slideOutUp');
}
function autocloseBar(parentele) {
    $(parentele).addClass('slideOutUp').removeClass('slideInDown');
}
function judgeFocuse(openid) {
    var obj = {
        name: '',
        imgUrl: '',
        love: [],
        phone: '',
        bindPhone: '',
        phone: '',
        bindPhoneStatus: '',
        subscribe:''
    };
    $.ajax({
        tyle: 'post',
        url: "http://10.122.202.211:8080/HD-newyear/newyear/getPlatFormUserInfo.action",
        dataType: "jsonp",
        jsonp: "callback",
        data: {
            openid: 'o8QKAuJKAMHQZ26zxWmO1uAdwvgw'
        },
        beforeSend: function() {
            //判断openId传过来了没有
            if (!Boolean(app['openId'])) {
                alert('获取openId失败');
            }
        },
        success: function(reospnse) {
            if (0 == reospnse.code) {
                var data = reospnse.data;
                //显示文字
                obj.bindPhone = data;
                console.log('-----',data.subscribe);
                if ('1'!= data.subscribe) {
                    $('.follow').show().addClass('slideInDown').removeClass('slideOutUp');
                    return data;
                };
                //获取用户的头像和昵称
                obj.name = data.nickname;
                obj.imgUrl = data.headImgUrl;
                obj.bindPhoneStatus = data.bindPhoneStatus;
                obj.subscribe=data.subscribe;
            };
        },
        error: function() {}
    });
    return obj;
};

function GetRequest() {
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for(var i = 0; i < strs.length; i ++) {
            theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}
